$masterName = $lb->getServerName( $lb->getWriterIndex() );
if ( $lb->getServerCount() > 1 ) {
$pos = $lb->getMasterPos();
- $this->logger->info( __METHOD__ . ": LB for '$masterName' has pos $pos\n" );
- $this->shutdownPositions[$masterName] = $pos;
+ if ( $pos ) {
+ $this->logger->info( __METHOD__ . ": LB for '$masterName' has pos $pos\n" );
+ $this->shutdownPositions[$masterName] = $pos;
+ }
} else {
$this->logger->info( __METHOD__ . ": DB '$masterName' touched\n" );
}
$failed = [];
foreach ( $lbs as $i => $lb ) {
if ( $masterPositions[$i] ) {
- // The DBMS may not support getMasterPos()
+ // The RDBMS may not support getMasterPos()
if ( !$lb->waitForAll( $masterPositions[$i], $opts['timeout'] ) ) {
$failed[] = $lb->getServerName( $lb->getWriterIndex() );
}
// Main LB is used; wait for any replica DBs to catch up
$masterPos = $lb->getMasterPos();
+ if ( !$masterPos ) {
+ return true; // not applicable
+ }
$loop = new WaitConditionLoop(
function () use ( $lb, $masterPos ) {